﻿<internals:PageBase
    x:Class="JV.Com.Views.PreviewGamePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JV.Com.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:converters="using:JV.Com.Converters"
    xmlns:internals="using:JV.Com.Internals"
    xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
    prism:ViewModelLocator.AutoWireViewModel="true">

    <Page.Resources>
        <converters:PreviewRatingToColorConverter x:Key="PRCConverter" />
        <converters:PreviewRatingToDisplayTextConverter x:Key="PRTConverter" />
    </Page.Resources>
    
    <Grid>
        <ProgressRing HorizontalAlignment="Center" VerticalAlignment="Center" IsActive="{Binding InLoading}"
                      Height="50" Width="50" Foreground="{StaticResource DataItemBorderThemeBrush}" />

        <Grid>
            <Grid.Transitions>
                <TransitionCollection>
                    <ContentThemeTransition />
                </TransitionCollection>
            </Grid.Transitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="140" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Border BorderBrush="{StaticResource DataItemBorderThemeBrush}" VerticalAlignment="Top" Grid.Row="1"
                            Background="White" BorderThickness="1" Margin="20, 0, 20, 20" MaxWidth="1500" Visibility="{Binding InLoading, Converter={StaticResource IB2VConverter}}">
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"
                              ZoomMode="Disabled" HorizontalScrollMode="Disabled">
                    <Grid Margin="20, 20, 40, 20">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="3*"/>
                            <ColumnDefinition Width="7*" />
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Vertical" Margin="0, 0, 20, 0">
                            <Image Source="{Binding ImageTopUrl}" Stretch="UniformToFill" />
                            <TextBlock FontSize="40" FontWeight="Bold" Margin="0, 20, 0, 0" Text="{Binding Rating, Converter={StaticResource PRTConverter}}"
                                       Foreground="{Binding Rating, Converter={StaticResource PRCConverter}}" />
                            <TextBlock Text="{Binding GlobalReview}" FontSize="15" TextAlignment="Justify" TextWrapping="Wrap"/>
                        </StackPanel>

                        <RichTextBlock x:Name="testBlock" HorizontalAlignment="Left" Style="{StaticResource RichTextBlockDefaultStyle}"
                                       Grid.Column="1"/>
                    </Grid>
                </ScrollViewer>
            </Border>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Button  x:Name="backButton" Style="{StaticResource NavigationBackButtonNormalStyle}"
                                 Margin="39,59,39,0" VerticalAlignment="Top"
                                 Command="{Binding GoBackCommand}"
                                 AutomationProperties.Name="Back"
                                 AutomationProperties.AutomationId="BackButton"
                                 AutomationProperties.ItemType="Navigation Button"/>
                <TextBlock x:Name="pageTitle" Text="{Binding PageTitle}" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1"
                                VerticalAlignment="Bottom" Margin="0,0,30,40" IsHitTestVisible="false" TextWrapping="NoWrap" />
                <SearchBox Grid.Column="2"
                                Height="35" Width="270" VerticalAlignment="Top"
                                PlaceholderText="Rechercher" QueryText="{Binding Query}"
                                SuggestionsRequested="SearchBox_SuggestionsRequested"
                                QuerySubmitted="SearchBox_QuerySubmitted" Margin="0, 63, 40, 0" />
            </Grid>
        </Grid>
    </Grid>
</internals:PageBase>
